<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>API 测试</title>
</head>
<body>
    <h1>API 测试页面</h1>
    <button onclick="testCaptcha()">测试验证码接口</button>
    <div id="result"></div>
    
    <script>
        async function testCaptcha() {
            try {
                const response = await fetch('http://localhost:8080/ybbx/auth/captcha');
                const data = await response.json();
                
                console.log('响应数据:', data);
                document.getElementById('result').innerHTML = `
                    <h3>响应结果:</h3>
                    <pre>${JSON.stringify(data, null, 2)}</pre>
                    <h3>验证码图片:</h3>
                    <img src="${data.data?.captchaImage}" alt="验证码" style="border: 1px solid #ccc;">
                `;
            } catch (error) {
                console.error('错误:', error);
                document.getElementById('result').innerHTML = `<p style="color: red;">错误: ${error.message}</p>`;
            }
        }
    </script>
</body>
</html>
